﻿/*----------------------------------------------------------------
// Copyright (C) 2016 通通优品版权所有。
// 命名空间: TongTongMall.MallWeb.Application.Users.Mapper
// 类名：UserBaseInfoMapper
// 功能描述：N/A
// 
// 创建标识：Roc.Lee(李鹏鹏) 2017/9/1 17:45:42 TEC-ROCLEE Roc.Lee

// 修改标识：
// 修改描述：
// 
//
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TongTongMall.MallWeb.Core.User.Models;
using TongTongMall.Oauth2._0.Models;

namespace TongTongMall.MallWeb.Application.Users.Mapper
{
    public class UserBaseInfoMapper
    {
        private static volatile bool _mappedBefore;
        private static readonly object SyncObj = new object();
        public static void CreateMappings()
        {
            lock (SyncObj)
            {
                if (_mappedBefore)
                {
                    return;
                }

                CreateMappingsInternal();
                _mappedBefore = true;
            }
        }

        private static void CreateMappingsInternal()
        {
            AutoMapper.Mapper.CreateMap<UserPreLoginCheckInfoDto, OAuthRedisUser>();

        }
    }
}
